<extend name="Base/base" />
<block name='head'> 
    <link rel="stylesheet" type="text/css" href="/Public/Index/css/plan_css.css">
    <link rel="stylesheet" type="text/css" href="/Public/Index/css/plan_demo.css"/>
    <title>关注计划</title>
</block>
<block name="content" > 
    <div class="attention_plan">
        <div class="st-container">
            <ul class="attention_plan_bt">
                <li class="pointer {$cType == 0 ? 'current' : ''}" data-type="0">
                    <span>{$total}</span><br/>全部
                </li>
                <foreach name="counts" item="count" key="key">
                    <if condition="$cType == 0 && ($key == 0)">
                        <li class="pointer noread_flag" data-type="{$count.type_id}">
                            <span class="count">{$count.count}</span><br/>{$count.type_name}
                        <if condition="$count['noRead'] eq 1">
                            <span class="readFlag countFlag"></span>
                        </if>
                        </li>
                        <else/>
                        <li class="pointer <if condition='$cType == $count[type_id]'>current</if> noread_flag" data-type="{$count.type_id}">
                            <span>{$count.count}</span><br/>{$count.type_name}
                        <if condition="$count['noRead'] eq 1">
                            <span class="readFlag countFlag"></span>
                        </if>
                        </li>
                    </if>
                </foreach>
<!--                <foreach name="counts" item="count" key="key">
                    <li class="pointer" data-type="{$count.type_id}">
                        <span>{$count.count}</span><br/>{$count.type_name}
                    </li>
                </foreach>-->
                <!--                <li class="pointer" data-type="2">
                                    <span>{$monthCount}</span><br/>月计划
                                </li>
                                <li class="pointer" data-type="11">
                                    <span>{$projectCount}</span><br/>项目计划
                                </li>
                                <li class="pointer" data-type="7">
                                    <span>{$yearCount}</span><br/>年计划
                                </li>-->
            </ul>
            <div class="st-scroll">
                <section class="st-panel">
                    <ul class="new_plan_lists">
                        <notempty name="allPlan">
                            <foreach name="allPlan" item="week" key="plan_id">
                                <li class="pointer">
                                    <a class="planInfo pointer"  data-id="{$week.plan_id}" data-dept="{$week.plan_id}" <if condition="$week[end_date] lt $week[today] and $week[end_date] neq '0000-00-00'">style="color:#ED8D76"</if>>
                                        <span class="plan_nr">{$plan_id+1}.{$week.name}</span>
                                        <span class="plan_att_num">{$week.total_percent}%</span>
                                    </a>
                                    <span class="collect">
                                        <i class="icon-guanzhu2 pointer cancelAtten" data-id="{$week.plan_id}"></i>
                                    </span>
                                </li>
                            </foreach>
                            <else />
                            <li><a href="#"><span class="plan_nr">暂无数据</span></a></li>
                        </notempty>
                    </ul> 
                </section>
            </div> 
        </div> 
    </div>
    <div class="plan_bottom">
        <ul>
            <li><a href="attentionPlan.html"><span class="plan_icon">&#xe624;</span>关注计划({$followCount|default=0})</a></li>
            <li><a href="allPlans.html"><span class="plan_icon">&#xe65b;</span>我的计划({$allCount|default=0})</a></li>
        </ul>
    </div>
    <input type="hidden" id="cancelAttenUrl" value="{:U('cancelAtten')}">
</block>
<block name="script">
    <script type="text/javascript" src="/Public/Index/js/planNew.js"></script>
    <script type="text/javascript">
        $(initFollowPlan());
        
        //动态加计划详情url
        $(function () {
            $('body .st-scroll').on('click', '.planInfo', function () {
                //var id = $(this).attr('data-dept');
                var id = $(this).attr('data-id');
                var cType = '';
                
                $('body').find('.attention_plan_bt li').each(function () {
                    if ($(this).hasClass('current')) {
                        cType = $(this).attr('data-type');
                    }
                })
//              alert('/index.php/Index/Plan/show/id/' + id + '/dept/' + dept + '/cType/' + cType);return;
                location.href = '/index.php/Index/Plan/show/id/' + id + '/type/follow/cType/' + cType;
            })
        })
    </script>
</block>
